<template>
  <div class="welcome-item fade-in">
    <div class="icon-container">
      <slot name="icon"></slot>
    </div>
    <div class="content">
      <h3 class="welcome-item-heading">
        <slot name="heading"></slot>
      </h3>
      <div class="welcome-item-body">
        <slot></slot>
      </div>
    </div>
  </div>
</template>

<style scoped>
.welcome-item {
  margin-top: var(--spacing-lg);
  display: flex;
  position: relative;
  padding: var(--spacing-lg);
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  border: 1px solid var(--color-border);
}

.welcome-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary-light);
}

.welcome-item:first-of-type {
  margin-top: 0;
}

.icon-container {
  display: flex;
  place-items: center;
  place-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--vt-c-primary-gradient);
  flex-shrink: 0;
}

.icon-container :deep(svg) {
  width: 24px;
  height: 24px;
  color: white;
}

.content {
  flex: 1;
  margin-left: var(--spacing-lg);
}

.welcome-item-heading {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  color: var(--color-secondary);
  transition: color var(--transition-normal);
}

.welcome-item:hover .welcome-item-heading {
  color: var(--color-primary);
}

.welcome-item-body {
  color: var(--color-text-secondary);
  line-height: 1.6;
  font-size: 0.95rem;
}

.welcome-item-body a {
  color: var(--color-primary);
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-normal);
  padding: 0 2px;
  border-radius: var(--radius-sm);
}

.welcome-item-body a:hover {
  color: var(--color-primary-dark);
  background-color: rgba(66, 185, 131, 0.1);
  transform: translateY(-1px);
}

.welcome-item-body code {
  background: var(--color-background-mute);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9em;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .welcome-item {
    padding: var(--spacing-md);
  }
  
  .icon-container {
    width: 40px;
    height: 40px;
  }
  
  .icon-container :deep(svg) {
    width: 20px;
    height: 20px;
  }
  
  .content {
    margin-left: var(--spacing-md);
  }
  
  .welcome-item-heading {
    font-size: 1.125rem;
  }
}

@media (max-width: 480px) {
  .welcome-item {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .icon-container {
    margin-bottom: var(--spacing-md);
  }
  
  .content {
    margin-left: 0;
  }
}
</style>
